// 创建store

import { defineStore } from "pinia"
import useCounter from "./counter"
import {ref} from "vue"
//定义store 第1个参数是一个唯一的id,可以随便写,id不能重复在其它store,第2个参数是一个对象,里面是我们的状态
let rootStore = defineStore("rootStore", ()=>{
    let count = ref(100);
    let active = ()=>{
        //使用了其他模块的store
        let counterStore = useCounter();
        count.value = counterStore.count
    }
    return {
        count,
        active
    }
})

export default rootStore